import rxAjax from '@/assets/js/ajax.js';

export const OsDimensionApi = {};

OsDimensionApi.baseUrl= '/api-user/user/org/osDimension';
OsDimensionApi.exportUrl= OsDimensionApi.baseUrl + '/listExport';

OsDimensionApi.query=function (parameter) {
  var url= OsDimensionApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

OsDimensionApi.getDimList=function(tenantId){
  var url= OsDimensionApi.baseUrl + '/getDimList';
  if(tenantId){
    url+="?tenantId="+tenantId;
  }
  return rxAjax.get(url)
}

OsDimensionApi.getByDimIds=function(dimIds){
  var url= OsDimensionApi.baseUrl + '/getByDimIds?dimIds='+dimIds;
  return rxAjax.get(url);
}

/**
 * 获取单记录
 * @param pkId
 * @returns {*}
 */
OsDimensionApi.get =function(pkId) {
  var url= OsDimensionApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

OsDimensionApi.save =function(parameter) {
  var url= OsDimensionApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

OsDimensionApi.del =function(parameter) {
  var url= OsDimensionApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

export  default OsDimensionApi;
